package cn.com.webConfiguration;

import cn.com.listener.ApplicationInitListener;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.EventListener;

/**
 * Created with IntelliJ IDEA.
 * User: yue
 * Date: 2018-03-30
 * Time: 23:10
 * Description:
 */
@Configuration
public class ListenerConfig {

    @Bean
    public ServletListenerRegistrationBean getApplicationInitListener(){
        ServletListenerRegistrationBean registrationBean = new ServletListenerRegistrationBean();
        registrationBean.setListener(new ApplicationInitListener());
        //registrationBean.setOrder(1);
        return registrationBean;
    }
}
